jQuery(function ($) {
                "use strict";
               function update(url) {
               $.ajax({url: url, dataType: "php"}).done(function (data) {
             var contenu = $(data).find('#wrapper');
                var newDiv = $("<div>").append(contenu);
                   $('#container').append(newDiv);
                    $("title").text($(data).filter("title").text());
                 $('#container>div:first-child').remove();
              });
             }

             $('.menu').on("click", "a", function (event) {
                   var $this = $(this);
                          event.preventDefault();
                          update($this.attr("href"));
              history.pushState(null, null, $this.attr("href"));
             });
             $(window).on("popstate", function (event) {
                 update(document.location.href);
             });

            });